import Vue from 'vue'
import Router from 'vue-router'
import user from './user'
import content from './content'
Vue.use(Router);

let mainRouter = [{
    path: '/',
    component: () => import('@/page/main'),
  }]

export default new Router({
  routes: [
    {
      path: '',
      name: 'index',
      component: () => import('@/page/index'),
      children: [
        ...mainRouter,
        ...user,
        ...content
      ]
    }, 
    {
      path: '/login',
      name: 'login',
      component: () => import('@/page/login'),
      
    }
  ],
  //进入页面就到定点到顶点
  scrollBehavior(to, from, savedPosition) {
    return {
      x: 0,
      y: 0
    }
  }
})
